
<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!--
/***********************************************
* 파일명   	: holidays_reg.jsp
* 기  능      	: 휴일등록 메인페이지
* 최초 작성일 	: 2009/02/12
* @author 	: Yang D
*************************************************
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<s:head theme="ajax" />
	<meta http-equiv="Content-Type" 	content="text/html; charset=UTF-8" />
	<meta http-equiv="pragma" 			content="no-cache" />
	<meta http-equiv="cache-control" 	content="no-cache" />
	<meta http-equiv="expires" 			content="0" />
	
	<title>휴일등록 </title>
	<link rel="stylesheet" type="text/css" href="/inc/css/common.css" />
	<script type="text/javascript" src="/inc/js/common.js"></script>
	<script type="text/javascript" src="inc/js/aa.js"></script>
	<!-- ============================== J A V A S C R I P T		S T  A R T ============================== -->
	<script type="text/javascript">
		//체크된 것인지 확인하기 위한 플래그.
		var flag	=	false;
		
		//휴일등록 추가
		function fnc_add() {

			var w = 350;
	       	var h = 270;
	       
	       	var x = fnc_center_x(w);
	       	var y = fnc_center_y(h);
			
			var uri		=	"holidaysAdd_p.action";
			var	nm		=	"popup";
			var attr    =   "width=" + w + " , height=" + h + " , top=" + y + " , left=" + x + " , status=no";   //window size
			
			window.open(uri , nm , attr);
			
			return false;
		}
		
		//코드 삭제
		function fnc_delete() {
			var f = document.frm;
			if(!fnc_chk_validate(f)) {
				return false;
			}
			
			if(!confirm("<s:text name="alert.message.questionDelete" />")) {
				//alert("취소하셨습니다.");
				return false;
			}

			f.action	=	"deleteHolidays.action";
			
			f.submit();
			
			return false;
		}
		
		//체크되었는지 확인함.
		function fnc_chk_validate(f) {
		
			if (typeof f.s_chk == "undefined") {
				alert("<s:text name="alert.message.noData" />");
				return false;
			}
		
			if (typeof f.s_chk.length == "undefined") {
				
				if(!f.s_chk.checked) {
					alert("<s:text name="alert.message.requiedCheck" />");
					f.s_chk.focus();
					
					return false;
				}
				
				return true;
				
			}
			
			for (var i = 0 ; i < f.s_chk.length ; i++) {
				if(!f.s_chk[i].checked) {
					continue;
				} else {
					flag = true;
				}
			}
			
			if (!flag) {
				alert("<s:text name="alert.message.requiedCheck" />");
				f.s_chk[0].focus();
				return flag;
			}
			
			return flag;
		}
		
		function fnc_dojo_publish() {
			dojo.event.topic.publish("ajax_list");
		}
		
		//휴일 수정
		function fnc_modify(seq) {

			var w = 350;
	       	var h = 230;
	       
	       	var x = fnc_center_x(w);
	       	var y = fnc_center_y(h);
	       	
			var uri		=	"holidaysMod_p.action";
			var	nm		=	"popup";
			var attr    =   "width=" + w + " , height=" + h + " , top=" + y + " , left=" + x + " , status=no";   //window size
			
			uri 		+=	"?" + "seq=" + seq;
			
			window.open(uri , nm , attr);
			
			return false;
		}

		//popup 정가운데 띄우기
		function fnc_center_x(w) {

	       	var x;
	       	
			x =  (screen.availWidth - w) / 2;

	       	return x;
		}

	  	//popup 정가운데 띄우기
		function fnc_center_y(h) {

	       	var y;
	       	
			y =  (screen.availHeight - h) / 2;

	       	return y;
		}

		function selectY(){
			$("#syear").css({backgroundColor:'#3366FF',color:'#FFFFFF'});
    		if($("#syear").val() == "ALL"){
                $("#syear").css({backgroundColor:'#ffffff',color:'#656464'});
	    		}
    		return false;
		}

		function selectM(){
			$("#smonth").css({backgroundColor:'#3366FF',color:'#FFFFFF'});
    		if($("#smonth").val() == "ALL"){
                $("#smonth").css({backgroundColor:'#ffffff',color:'#656464'});
	    		}
    		return false;
		}
		
	</script>
	<!-- ============================== J A V A S C R I P T 	E	N	D ============================== -->
</head>
<!-- ============================== BODY START ============================== -->
<body>
<!--------- Contants Range : STR--------------->
	<div class="fl_ri">
		<div id="contants_box">
			<div id="tit">  
				<span class="fl_ri tit_navi">Home &gt; 관리자 &gt; <span class="f_b">공휴일관리 </span><img src="/images/btl_navi.gif" class="img_tp"></span>
				<div class="fl_le"><img src="/images/tit_menu05_img04.gif" /></div>
			</div>
			<s:form name="frm"  theme="simple" method="post" id="frm">
				<s:hidden id="cur_page" name="cur_page"/>    <!-- 현재페이지 -->
			
				<!----------Search_Box : STR ---------->
				<div id="search03">
					<div id="search_box03">
						<ul>
							<li class="txt">조회년도</li>
							<li class="input">
								<s:select name="syear" 	id="syear"	cssClass="combobox100se" list="listYear" listKey="year" listValue="yyyy" onchange="return selectY()"/>
							</li>
							<li class="txt01">월</li>
							<li class="input01">
								<s:select name="smonth" id="smonth"	cssClass="combobox100se" list="#{'01':'1' , '02':'2' , '03':'3' , '04':'4' , '05':'5' , '06':'6' , '07':'7' , '08':'8' , '09':'9' , '10':'10' , '11':'11' , '12':'12'}" headerKey="ALL" headerValue="::전체::" onchange="return selectM()"/>						
							</li>
						</ul>
						<ul class="btn">
							<span class="fl_ri">
								<img src="/images/btn_search03.gif" style="cursor: pointer;" onclick="return getList('search')" />
								<img src="/images/btn_add02.gif" title="휴일등록" 	class="img_tm" style="cursor: pointer;" onclick="return fnc_add()" />
								<img src="/images/btn_sdelete.gif" class="img_tm"	title="삭제" value="삭제" style="cursor: pointer;" onclick="return fnc_delete()" />
							</span>
							
						</ul>
					</div>
				</div>	
				<!----------Search_Box : END ---------->
				<s:url id="no_url" action="holidaysAjaxList" />
				<s:div showLoadingText="false" href="%{no_url}"  theme="ajax" listenTopics="ajax_list" formId="frm" executeScripts="true" />
			</s:form>
		</div>
	</div>
	<!--------- Contants Range : END--------------->
</body>
</html>